<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <style>
    .indexTop {
      width: 60em;
      height: 40em;
      text-align: center;
      margin: 0 auto;
      position: relative;
      background-color: darkslategrey;
    }

    .divleft {
      width: 30em;
      height: 40em;
      background: red;
      float: left;
      -webkit-background-size: 100% 100%;
      background-size: 100% 100%;
    }

    .divright {
      width: 30em;
      height: 40em;
      background: yellow;
      float: right;
      -webkit-background-size: 100% 100%;
      background-size: 100% 100%;
    }

    .inputLogin {
      background: blue;
      width: 20em;
      height: 5em;
      position: absolute;
      top: 40em;
      display: block;
      margin-left: 35%;
    }
  </style>
</head>

<body>
  <div class="indexTop">
    <div class=" divleft" id="left"></div>
    <div class=" divright" id="right"></div>
    <input type="button" value="点击登录" class="inputLogin">
  </div>
</body>
<script>
  var i = 0;
  var timeid;
  $("input[type=button]").click(function () {
    timeid = setInterval(function () {
      i = i + 0.4;
      css(i)
    }, 1)

  })

  function css(i) {
    if (i < 72) {
      $("#left").css("transform", "rotateY(" + i + "deg)");
      $("#left").css("transform-origin", "left");
      $("#right").css("transform", "rotateY(-" + i + "deg)");
      $("#right").css("transform-origin", "right");
    } else {
      clearInterval(timeid);
    }
  }
</script>

</html>